import { createRouter, createWebHashHistory } from 'vue-router'


const routes = [
  {
    path: '/',
    redirect: '/lesson1'
  },
  {
    path: '/lesson1',
    name: 'lesson1',
    meta: { title: '第一课' },
    component: () => import('../views/lesson1')
  },
  {
    path: '/lesson2',
    name: 'lesson2',
    meta: { title: '第二课' },
    component: () => import('../views/lesson2')
  },
  {
    path: '/lesson3',
    name: 'lesson3',
    meta: { title: '第三课' },
    component: () => import('../views/lesson3')
  },
  {
    path: '/lesson4',
    name: 'lesson4',
    meta: { title: '第四课' },
    component: () => import('../views/lesson4')
  },
  {
    path: '/lesson5',
    name: 'lesson5',
    meta: { title: '第五课' },
    component: () => import('../views/lesson5')
  },
  {
    path: '/lesson6',
    name: 'lesson6',
    meta: { title: '第六课' },
    component: () => import('../views/lesson6')
  },
  {
    path: '/lesson7',
    name: 'lesson7',
    meta: { title: '第七课' },
    component: () => import('../views/lesson7')
  },
  {
    path: '/lesson8',
    name: 'lesson8',
    meta: { title: '第八课' },
    component: () => import('../views/lesson8')
  },
  {
    path: '/artcle/:id',
    name: 'artclePage',
    component: () => import('../views/lesson7/ArtclePage')
  },
  {
    path: '/:pathMatch(.*)',
    component: () => import('@/views/ErrorPage')
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})
export { routes }
export default router
